<template>
	<div>
		<div v-for="(item, index) in arr" :key="index">
			<span v-if="item.children">{{ item.meta.title }}</span>
			<router-link v-else :to="`${item.path}`">
				{{ item.meta.title }}
			</router-link>
			<div v-if="item.children" style="padding-left: 50px">
				<div v-for="(obj, k) in item.children" :key="k">
					<router-link :to="`${item.path}/${obj.path}`">
						{{ obj.meta.title }}
					</router-link>
				</div>
			</div>
		</div>
	</div>
</template>

<script setup>
import routes from '@/router/routes';

const routesArray = routes;
let arr = [];
routesArray.map((item) => item.path && arr.push(item));
</script>

<style lang="less" scoped></style>
